﻿<%@ Page Title="Master Data Activity" Language="C#" MasterPageFile="~/NPS/app/MasterData/masterdata.master" AutoEventWireup="true" CodeFile="Activity.aspx.cs" Inherits="NPS_app_MasterData_Activity" %>

<asp:Content ContentPlaceHolderID="Back" runat="server">
    <a class="backbutton" href="../../Default.aspx" data-bind="click: closeApp">
        <img src="../../img/Left.png" />
    </a>
</asp:Content>
<asp:Content ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        function numericFilter(txb) {
            txb.value = txb.value.replace(/[^\0-9]/ig, "");
        }
    </script>
</asp:Content>
<asp:Content ContentPlaceHolderID="Header" runat="server">
    <asp:Literal ID="ltrTitle" runat="server"></asp:Literal>
</asp:Content>
<asp:Content ContentPlaceHolderID="body" runat="server">
    <div id="body">
        <div class="container metro">            
            <form class="metro-form" runat="server" id="MasterData">
                <asp:Panel ID="pnlView" runat="server">
                    <asp:Button ID="btnCreate" OnClick="btnCreate_Click" runat="server" CssClass="metro-button" Text="Create New" /><br/><br/>                      
                    <div class="metro-form-control" style="width: 350px">
                        <div class="metro-text-box">
                            <asp:TextBox ID="txtFilter" runat="server" Width="250px" ></asp:TextBox>
                            <asp:Button ID="btnFilter" OnClick="btnFilter_Click" runat="server" CssClass="metro-button-srch" Text="Filter" />
                        </div>
                    </div>
                    <asp:GridView ID="GridView1" runat="server"
                        AutoGenerateColumns = "false" Font-Names = "Arial"
                        Font-Size = "11pt" AlternatingRowStyle-BackColor = "#C2D69B" 
                        HeaderStyle-BackColor = "green" AllowPaging ="true"  
                        OnPageIndexChanging = "OnPaging"
                        PageSize = "10" OnRowCommand="OnRowCommand_Click" >
                       <Columns>                               
                        <asp:BoundField ItemStyle-Width = "30px" ItemStyle-HorizontalAlign="Center"
                          DataField = "ID" HeaderText = "ID" />
                        <asp:BoundField ItemStyle-Width = "250px" 
                          DataField = "Activity_name" HeaderText = "Activity_name"/>
                        <asp:BoundField ItemStyle-Width = "250px"
                          DataField = "Deskripsi" HeaderText = "Deskripsi"/>
                        <asp:BoundField ItemStyle-Width = "100px" ItemStyle-HorizontalAlign="Center"
                          DataField = "Kuota" HeaderText = "Kuota"/>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:LinkButton ID="lnkEdit" runat="server" Text="Edit" CommandName="Editing" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>"></asp:LinkButton>
                                <asp:LinkButton ID="lnkDetails" runat="server" Text="Details" CommandName="Details" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>"></asp:LinkButton>
                                <asp:LinkButton ID="lnkDelete" runat="server" Text="Delete" CommandName="Deleting" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                       </Columns>
                       <AlternatingRowStyle BackColor="#C2D69B"  />
                    </asp:GridView>    
                </asp:Panel> 
                
                <asp:Panel ID="pnlCreate" runat="server">
                    <div class="metro-form-control" style="width: 300px">
                        <label>Activity_Name</label>
                        <div class="metro-text-box">
                            <asp:TextBox ID="txtCActivity" runat="server" ></asp:TextBox>
                        </div>
                    </div>
                    <div class="metro-form-control" style="width: 300px">
                        <label>Deskripsi</label>
                        <div class="metro-text-box">
                            <asp:TextBox ID="txtCDeskripsi" runat="server" TextMode="MultiLine"></asp:TextBox>
                        </div>
                    </div>
                    <div class="metro-form-control" style="width: 300px">
                        <label>Kuota</label>
                        <div class="metro-text-box">
                            <asp:TextBox ID="txtCKuota" runat="server" onKeyUp="numericFilter(this);" ></asp:TextBox>
                        </div>
                    </div>
                    <asp:Button ID="btnCSave" OnClick="btnCSave_Click" runat="server" CssClass="metro-button" Text="Simpan" /> &nbsp;
                    <asp:Button ID="btnCCancel" OnClick="btnCCancel_Click" runat="server" CssClass="metro-button" Text="Batal" />
                </asp:Panel>
               
                <asp:Panel ID="pnlEdit" runat="server">
                    <div class="metro-form-control" style="width: 300px">
                        <label>Activity_Name</label>
                        <div class="metro-text-box">
                            <asp:TextBox ID="txtEActivity" runat="server" ></asp:TextBox>
                        </div>
                    </div>
                    <div class="metro-form-control" style="width: 300px">
                        <label>Deskripsi</label>
                        <div class="metro-text-box">
                            <asp:TextBox ID="txtEDeskripsi" runat="server" TextMode="MultiLine"></asp:TextBox>
                        </div>
                    </div>
                    <div class="metro-form-control" style="width: 300px">
                        <label>Kuota</label>
                        <div class="metro-text-box">
                            <asp:TextBox ID="txtEKuota" runat="server" onKeyUp="numericFilter(this);" ></asp:TextBox>
                        </div>
                    </div>
                    <asp:Button ID="btnESave" OnClick="btnESave_Click" runat="server" CssClass="metro-button" Text="Simpan" /> &nbsp;
                    <asp:Button ID="btnECancel" OnClick="btnECancel_Click" runat="server" CssClass="metro-button" Text="Batal" />                
                </asp:Panel>
                
                <asp:Panel ID="pnlDetails" runat="server">                    
                    <div class="metro-form-control" style="width: 300px">                        
                        <div class="metro-text-box">
                            <table>
                                <tr>
                                    <td>ID</td>
                                    <td>&nbsp; : </td>
                                    <td><asp:Label ID="lblDID" runat="server"></asp:Label></td>
                                </tr>
                                <tr>
                                    <td>Activity_Name</td>
                                    <td>&nbsp; : </td>
                                    <td><asp:Label ID="lblDAN" runat="server"></asp:Label></td>
                                </tr>
                                <tr>
                                    <td>Deskripsi</td>
                                    <td>&nbsp; : </td>
                                    <td><asp:Label ID="lblDDes" runat="server"></asp:Label></td>
                                </tr>
                                <tr>
                                    <td>Kuota</td>
                                    <td>&nbsp; : </td>
                                    <td><asp:Label ID="lblDKuota" runat="server"></asp:Label></td>
                                </tr>
                            </table>
                        </div>
                    </div>
                    
                    <asp:Button ID="btnDEdit" OnClick="btnDEdit_Click" runat="server" CssClass="metro-button" Text="Edit" /> &nbsp;
                    <asp:Button ID="btnDBack" OnClick="btnDBack_Click" runat="server" CssClass="metro-button" Text="Back to List" />   
                </asp:Panel>
                
                <asp:Panel ID="pnlDelete" runat="server">
                <div class="metro-form-control" style="width: 300px">                        
                        <div class="metro-text-box">
                            <table>
                                <tr>
                                    <td>ID</td>
                                    <td>&nbsp; : </td>
                                    <td><asp:Label ID="lblID" runat="server"></asp:Label></td>
                                </tr>
                                <tr>
                                    <td>Activity_Name</td>
                                    <td>&nbsp; : </td>
                                    <td><asp:Label ID="lblAN" runat="server"></asp:Label></td>
                                </tr>
                                <tr>
                                    <td>Deskripsi</td>
                                    <td>&nbsp; : </td>
                                    <td><asp:Label ID="lblDes" runat="server"></asp:Label></td>
                                </tr>
                                <tr>
                                    <td>Kuota</td>
                                    <td>&nbsp; : </td>
                                    <td><asp:Label ID="lblKuota" runat="server"></asp:Label></td>
                                </tr>
                            </table>
                        </div>
                    </div>
                    
                    <asp:Button ID="btnDelete" OnClick="btnDelete_Click" runat="server" CssClass="metro-button" Text="Delete" /> &nbsp;
                    <asp:Button ID="btnBack" OnClick="btnBack_Click" runat="server" CssClass="metro-button" Text="Back to List" />  
                </asp:Panel>
            </form>
        </div>
    </div>
</asp:Content>
